package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.domain.AccountsReceivableDO;
import com.iotechn.unimall.data.dto.purchase.ArrearsDetailsDTO;
import com.iotechn.unimall.data.dto.warehouse.StoreReceivableDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


/**
 * 应收账款表
 * 
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-03-26 16:18:07
 */
public interface AccountsReceivableMapper extends BaseMapper<AccountsReceivableDO> {
    /**
     * 查看所有的商户的应收账款
     * @param storeName
     * @param storeNo
     * @param offset
     * @param limit
     * @return
     */
    public List<StoreReceivableDTO> selectStoreReceivable(@Param("storeNo") String storeNo, @Param("storeName") String storeName,@Param("warehouseIds") List<Long> warehouseIds, @Param("offset") Integer offset, @Param("limit") Integer limit);

    /**
     * 采购端查询   根据客户分组
     * @return
     */
    public List<StoreReceivableDTO> selectPurchaseStoreReceivableBycontact();

    /**
     * 根据时间分组
     * @return
     */
    public List<StoreReceivableDTO> selectPurchaseStoreReceivableByTime();

    /**
     * 查询前看详情
     * @return
     */
    public List<ArrearsDetailsDTO> getArrearsDetails();



    public Long selectStoreReceivableCount(@Param("storeNo") String storeNo, @Param("storeName") String storeName,@Param("warehouseIds") List<Long> warehouseIds);

    /**
     * 根据时间 查询欠款详情
     * @param gmtStartTime
     * @param gmtEndTime
     * @return
     */
    public List<ArrearsDetailsDTO> getArrearsDetailsByTime(@Param("gmtStartTime") Date gmtStartTime,@Param("gmtEndTime") Date gmtEndTime);


    /**
     * 根据供应商查询
     * @param customerId
     * @return
     */
    public List<ArrearsDetailsDTO> getArrearsDetailsByCustomer(@Param("customerId") Long customerId);
}
